#ifndef BROOT_WRAPPER_H_INCLUDED
#define BROOT_WRAPPER_H_INCLUDED

#include "broot_force.h"

class BrootForceWrapper
{
public:
    void runBroot(size_t d)
    {
        OnlineSymmetricChecker onlineChecker;
        FinalSymmetricChecker finalChecker;
        OnlineSymmetricCoordChecker coordChecker;
        ProcessState state;
        state.numVertecies = 2;
        for(size_t v = 0; v <= NUM_VERTICES; v = v * 3 + 1) {
            state.vertecies[0] = v;
            size_t parity = distanceCalculator(0, v) % 2;
            FullParityGraph g(d, d, parity);
            const std::vector<size_t>& inc = g.incendents(v);
            for(size_t i = 0; i < inc.size(); ++i) {
                size_t u = inc[i];
                state.vertecies[1] = u;
                if (onlineChecker.check(state) &&
                    finalChecker.check(state) &&
                    coordChecker.check(state)) {
                    vector<size_t> lims(state.vertecies, state.vertecies + 2);
                    FullParityGraph fullSearchGraph(d + 1, 4 * n, parity);
                    FullParityGraph resultGraph(d, d, parity, lims);
                    std::vector<size_t> verts;
                    for(size_t w = 0; w < NUM_VERTICES; ++w) {
                        if (resultGraph.degree(w) != 0) {
                            verts.push_back(w);
                        }
                    }
                    IgnoreGraph searchGraph(&fullSearchGraph, verts);
                    BrootForce bf(&searchGraph, &resultGraph, d, lims);
                    std::cerr << "processing graph distance = " << d 
                        << " with vertex " << v << " and limitters " << lims
                        << " num vertices = " << verts.size() << std::endl;
                    bf.run();

                }
            }
        }

    }
};

#endif//BROOT_WRAPPER_H_INCLUDED

